1. Field of the Invention
The present invention relates to a storage device and a control method of the storage device.
2. Description of the Related Art
A general magnetic disc device (HDD) accesses data stored in a storage medium by rotating the storage medium using a spindle motor which constitutes a driving unit of the magnetic disc device.
FIG. 1 is a block diagram schematically showing a configuration of a magnetic disc device serving as a storage device in the related art. In FIG. 1, a storage device 20 is a hybrid hard disc device including a magnetic disc 12 as a storage medium, and a flash memory 14A as a nonvolatile memory.
The storage device 20 writes data to the flash memory 14A while a spindle motor 11 is in an off-state. Accordingly, even when a power source is unexpectedly disconnected, the data is less likely to be lost during processing.
The storage device 20 is connected to a host 1, which is a higher-level device, and performs writing and reading in response to a command issued by the host 1 on the magnetic disc 12 which is driven to rotate using the spindle motor 11.
The storage device 20 further includes a controller 23, a volatile memory (DRAM) 14B serving as a temporary memory, and the flash memory 14A capable of storing data even when a power source is disconnected.
The volatile memory 14B is used to adjust a difference between a speed at which data to be written is transmitted from the host 1 to the storage device 20 and a speed at which the data is written to the magnetic disc 12 or the flash memory 14A.
The controller 23 is used to write data to the magnetic disc 12 or the flash memory 14A in accordance with a state of the spindle motor 11. That is, while the spindle motor 11 stops driving, the data is written to the flash memory 14A.
Furthermore, the controller 23 is used to control an operation in which the data is written back from the flash memory 14A (hereinafter referred to as a “writing-back operation”). That is, the controller 23 controls an operation in which the data is read from the flash memory 14A and recorded in the magnetic disc 12.
Moreover, the controller 23 performs control of the writing-back operation so as to be executed when a usage rate of the flash memory 14A reaches 100% (refer to Japanese Unexamined Patent Application Publication Nos. 6-309776, 2006-260759 and 2000-200461).
FIG. 2 is a diagram illustrating the relationship between a usage rate of the flash memory 14A and a period of time in which the spindle motor 11 is driven in the storage device 20 shown in FIG. 1.
Data supplied from the host 1 is written to the flash memory 14A which is a nonvolatile memory.
However, when the usage rate of the flash memory 14A is 100%, the data should be written to the magnetic disc 12 by driving the spindle motor 11.
Accordingly, in such a control operation, when the usage rate of the flash memory 14A is 100%, the data supplied from the host 1 is stored in the volatile memory 14B for a period of time (T2−T1) required for driving the magnetic disc 12 to rotate, and therefore, the data is highly likely to be lost if a power supply is unexpectedly disconnected at such a time.
To address this problem, the spindle motor 11 may be controlled to be driven, when the usage rate of the flash memory 14A reaches a predetermined usage rate (for example, 80%), so as to start writing the data to the magnetic disc 12.
However, in this case, since the usage rate of the flash memory 14A is limited to 80%, the usability of the flash memory 14A deteriorates.